/* 输出文件浏览器样式 */
.output-file-browser-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease-out;
}

.output-file-browser {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 1000px;
  height: 80vh;
  max-height: 600px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease-out;
  overflow: hidden;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(30px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

/* 头部样式 */
.file-browser-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 12px 12px 0 0;
}

.file-browser-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.refresh-btn, .close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.refresh-btn:hover, .close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

.refresh-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 内容区域 */
.file-browser-content {
  flex: 1;
  padding: 20px;
  overflow: auto;
}

/* 状态样式 */
.loading-state, .error-state, .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  text-align: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.error-state p {
  color: #e74c3c;
  margin-bottom: 15px;
}

.error-state button {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.error-state button:hover {
  background: #c0392b;
}

.empty-state p {
  color: #666;
  margin: 5px 0;
}

/* 文件列表样式 */
.files-list {
  background: #f8f9fa;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e9ecef;
}

.files-header {
  background: #e9ecef;
  padding: 12px 15px;
  display: grid;
  grid-template-columns: 2fr 1fr 100px 150px 150px;
  gap: 15px;
  font-weight: 600;
  font-size: 14px;
  color: #495057;
  border-bottom: 1px solid #dee2e6;
}

.file-item {
  padding: 12px 15px;
  display: grid;
  grid-template-columns: 2fr 1fr 100px 150px 150px;
  gap: 15px;
  align-items: center;
  border-bottom: 1px solid #f1f3f4;
  background: white;
  transition: all 0.2s ease;
  cursor: pointer;
}

.file-item:hover {
  background: #f8f9fa;
  transform: translateX(2px);
}

.file-item.selected {
  background: #e3f2fd;
  border-left: 4px solid #2196f3;
}

.file-item:last-child {
  border-bottom: none;
}

/* 文件信息 */
.file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.file-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.file-name {
  font-weight: 500;
  color: #2c3e50;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-type .app-name {
  color: #666;
  font-size: 13px;
  background: #f1f3f4;
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

.file-size {
  color: #666;
  font-size: 13px;
  text-align: right;
}

.file-modified {
  color: #666;
  font-size: 12px;
}

/* 操作按钮 */
.file-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.open-btn, .download-btn {
  background: #667eea;
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.open-btn:hover {
  background: #5a67d8;
  transform: translateY(-1px);
}

.download-btn {
  background: #48bb78;
}

.download-btn:hover {
  background: #38a169;
  transform: translateY(-1px);
}

/* 底部信息 */
.file-browser-footer {
  background: #f8f9fa;
  padding: 15px 20px;
  border-top: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 0 0 12px 12px;
}

.file-count {
  margin: 0;
  color: #666;
  font-size: 14px;
  font-weight: 500;
}

.tip {
  margin: 0;
  color: #999;
  font-size: 12px;
  font-style: italic;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .output-file-browser {
    width: 95%;
    height: 90vh;
    margin: 5vh auto;
  }
  
  .files-header, .file-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .file-type, .file-size, .file-modified {
    display: none;
  }
  
  .file-actions {
    justify-content: flex-start;
    margin-top: 8px;
  }
  
  .file-browser-footer {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
}

/* 滚动条样式 */
.file-browser-content::-webkit-scrollbar {
  width: 8px;
}

.file-browser-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.file-browser-content::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.file-browser-content::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
} 